<?php

/*
|--------------------------------------------------------------------------
| Web Routes
|--------------------------------------------------------------------------
|
| Here is where you can register web routes for your application. These
| routes are loaded by the RouteServiceProvider within a group which
| contains the "web" middleware group. Now create something great!
|
*/

Route::get('resource/list', 'ResourceController@getList');
Route::post('modifySort', 'SlideShowsController@postModifySort');
Route::get('/home', 'HomeController@index')->name('home');

Auth::routes();

Route::post('batchUploads', 'BatchUploadController@postUploads')->name('uploadProducts');
Route::post('uploadImage', 'BatchUploadController@uploader')->name('uploadImage');

Route::get('/', 'IndexController@getIndex')->name('index');
Route::get('about', 'IndexController@getAboutUs')->name('about');
Route::get('join', 'IndexController@getJoinUs')->name('join');
Route::get('activity', 'ActivityController@index')->name('activity');

Route::group(['prefix' => 'user', 'middleware' => 'auth'], function (){
    Route::post('collect', 'CollectController@postCollect')->name('userCollect');
});

Route::group(['prefix' => 'product'], function (){
    Route::get('detail/{id}', 'ProductController@getDetail');
    Route::get('list', 'ProductController@getList');
    Route::get('bookGradeInfo', 'ProductController@getBookGradeInfo')->name('ajaxGradeInfo');
    Route::get('/', 'ProductController@getIndex')->name('productIndex');
    Route::get('info/{uuid}', 'ProductController@getInfo')->name('productInfo');
});

Route::group(['prefix' => 'resource'], function (){
    Route::get('/', 'DownloadController@getIndex')->name('resourceIndex');
    Route::get('adminGetList', 'DownloadController@getTryOutList')->name('fileList');
    Route::post('download', 'DownloadController@postDownload')->name('resourceDownload');
    Route::get('downloadFile', 'DownloadController@postDownload')->name('downloadFile')->middleware('signedurl');
});

Route::group(['prefix' => 'topics'], function (){
    Route::get('detail', 'TopicsController@getDetail')->name('topicsDetail');
});

Route::group(['prefix' => 'en'], function (){
    Route::get('/', 'IndexController@getEnglishIndex')->name('enIndex');
    Route::get('detail/{uuid}', 'ProductController@getEnglishInfo')->name('enDetail');
    Route::get('trade', 'TradeController@index')->name('enTrade');
});

Route::group(['prefix' => 'home','namespace'=>'Home','middleware'=>'auth'], function (){
	Route::get('/', 'HomeController@index')->name('home');//用户管理中心首页
	Route::get('orders','OrdersController@getList')->name('userorders');//订单管理
	Route::get('/recharge','HomeController@recharge')->name('userrecharge');//余额管理页面
	Route::get('/payment', 'HomeController@payment')->name('payment');//充值中心页面
// 	Route::get('/alipaysuccess', 'HomeController@paymentSuccess')->name('alipaysuccess');//返回充值成功
	Route::post('/userprofiles','HomeController@setUserProfiles')->name('setuserprofiles');//设置用户信息
    Route::any('reviseTel/verify', 'HomeController@verifyMobile')->name('reviseMobile.verify'); //验证手机号码
    Route::any('reviseTel/revise', 'HomeController@reviseMobile')->name('reviseMobile.revise'); //修改手机号码
    Route::get('reviseTel/done', 'HomeController@getReviseDone')->name('reviseMobile.done'); //修改完成

});
//支付宝路由
Route::group(['prefix' => 'pay','namespace'=>'Payment'], function (){
	Route::get('/alipayweb', 'AlipayController@getPay')->name('alipayweb');//支付宝付款页面
	Route::get('/alipaysuccess', 'AlipayController@getReturnUrl')->name('alipaysuccess');
	Route::any('/alipaynotify', 'AlipayController@getNotifyurl')->name('alipaynotify');//支付宝异步通知
	
});

Route::group(['prefix' => 'pwd', 'middleware' => 'guest'], function (){
//    Route::get('verifyAccount', 'HomeController@getFindPwd')->name('getVerifyAccount');
//    Route::post('verifyAccount', 'HomeController@postVerifyAccount')->name('postVerifyAccount');
    Route::get('check', 'HomeController@getVerifyMobile')->name('getVerifyMobile');
    Route::post('check', 'HomeController@postVerifyMobile')->name('postVerifyMobile');
//    Route::post('setNewPassword', 'HomeController@postSetNewPassword')->name('postSetNewPassword');
    Route::get('reset', 'HomeController@getReset')->name('getReset');
    Route::post('reset', 'HomeController@postReset')->name('postReset');
    Route::get('done', 'HomeController@getResetPwdDone')->name('getResetPwdDone');
});
	
Route::get('/mobileCode', 'PushController@mobileSecuriytCode')->name('mobileCode');
//Route::get('/findpassword', 'HomeController@findPassword')->name('findpassword');
//Route::get('password/reset', 'Auth\ForgotPasswordController@resetByPhone')->name('password.request');
//Route::post('/password/verification', 'Auth\ForgotPasswordController@sendResetVerification')->name('password.verification');
Route::get('/error', 'HomeController@pageError')->name('pageerror');



